package engine.newUi
{
	import engine.data.ModelLocator;
	import engine.data.ObjectData;
	import engine.data.ViewObject;
	import engine.flag.GameDefine;
	import engine.flag.ResourcesPath;
	import engine.net.datatype.WString;
	import engine.net.event.CustomMsgEvent;
	import engine.net.messages.CustomToClientFlag;
	import engine.net.messages.CustomToServerFlag;
	import engine.net.mgr.SystemSender;
	import engine.tip.TipsMainLogic;
	
	import flash.events.DataEvent;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.utils.getQualifiedClassName;
	
	import newx.BaseObject;
	import newx.com.config.StaticIni;
	import newx.com.control.window.NxWindowEvent;

	/**
	 *详细属性 
	 * @author yanghr
	 * 
	 */
	public class DetailPropertyLogic 
	{
		private  var _ui:DetailPropertyUI;
		private static var _self:DetailPropertyLogic;
		/**
		 *xml属性名 
		 */		
		private const PLAYER:String	=	"player",
			PLAYER_PROPERTY:String="Property",
			PARTNER:String	=	"PartnerBox",
			PLAYER_EQUIP:String=	"EquipBox",
			PARTNER_ITEM:String	=	"PartnerItem",
			PARTNER_PROPERTY:String="PartnerProperty",
			PARTNER_EQUIP:String="PartnerEquip",
			OBJECT:String="Object ",
			PROPERTISE:String=	"Properties",
			ITEM:String="Item";
		
		private const NAME:String="Name";
		private var _tips:TipsMainLogic;
		private var _partnerXmap:Object=new Object;
		/**
		 *当前查看的主角名 
		 */		
		private var _mainRoleName:String;
		/**
		 *传入数据 
		 */		
		private var _mainObj:*;
		private var _model:ModelLocator;
		private var _needRefreshUi:Boolean=false;
		
		private var _isother:Boolean=true;
		/**
		 *true  就是查看他人详细属性
		 * false 自己详细属性 
		 * @return 
		 * 
		 */		
		public function get isOther():Boolean
		{
			return _isother;
		}
		
		private var _actorLogic:ActorPropertyLogic;
		/**
		 * 超级无敌宇宙霹雳 属性表
		 *	--级别
			local level   = 0;
			--生命
			local hp     = 0;
			--普通攻击
			local normaldamage = 0;
			--普通防御
			local normalphydef = 0;
			--绝技攻击
			local finaldamage = 0;
			--绝技防御
			local finalmagdef = 0;
			--个人先攻
			local speedrate = 0;
			--闪避
			local dodgeprob = 0;
			--命中
			local hitprob = 0;
			--抵挡
			local wardprob = 0;
			--破击
			local dewardprob = 0;
			--虚招
			local guardprob = 0;
			--破招
			local deguardprob = 0;
			--暴击
			local vaprob = 0;
			--韧性
			local vadefprob = 0;
			--必杀
			local vadamageratio = 0;
		 */		
		private var propertyMap:Object={
			maxlife:ActorPropertyUI.MAX_HP,
			lvl:ActorPropertyUI.LEVEL,
			normalAtt:"normaldamage",
			normalDef:"normalphydef",
			skillAtt:"finaldamage",
			skillDef:"finalmagdef",
			headAtt:"speedrate",
			dodge:"dodgeprob",
			hitProb:"hitprob",
			wardProb:"wardprob",
			wardweak:"dewardprob",
			gardProb:"guardprob",
			guardweak:"deguardprob",
			vaProb:"vaprob",
			vaDef:"vadefprob",
			vaDamage:"PhyVaDamageRatioAdd"
		};
		public static function getInstance():DetailPropertyLogic
		{
			if(_self==null)
			{
				_self=new DetailPropertyLogic(false);
			}
			return _self;
		}
		public function DetailPropertyLogic(isother:Boolean):void
		{
			_isother=isother
		}
		private function mouseOverHandle(e:Event):void
		{
			var str:String="";
			var plist:Array=[];
			switch(e.target)
			{
				case ui.faceClip:
				{
					
					break;
				}
				case ui.nameTxT:
				{
					
					break;
				}	
				case ui.professTxT:
				{
					
					break;
				}
				case ui.skillTxT:
				{
					
					break;
				}
				case ui.lvlTxT:
				{
					str	=	"PlayerTipsStr_00";
					break;
				}
				case ui.normalAttackTxT:
				{
					str= "PlayerTipsStr_02";
					break;
				}
				case ui.normalDefTxT:
				{
					str="PlayerTipsStr_03";
					break;
				}
				case ui.skillAttackTxT:
				{
					str="PlayerTipsStr_04";
					break;
				}
				case ui.skillDefTxT:
				{
					str="PlayerTipsStr_05"
					break;
				}
				case ui.dodgeTxT:
				{
					str="PlayerTipsStr_06";
					break;
				}
				case ui.wardProbTxT:
				{
					str="PlayerTipsStr_08";
					break;
				}
				case ui.gardProbTxT:
				{
					str="PlayerTipsStr_10";
					break;
				}
				case ui.vaProbTxT:
				{
					str="PlayerTipsStr_12"
					break;
				}
				case ui.vaDamageTxT:
				{
					str="PlayerTipsStr_14";
					break;
				}
				case ui.lifeTxT:
				{
					str="PlayerTipsStr_01"
					break;
				}
				case ui.hitProbTxT:
				{
					str="PlayerTipsStr_07";
					break;
				}
				case ui.wardWeakTxT:
				{
					str="PlayerTipsStr_09";
					break;
				}
				case ui.guardWeakTxT:
				{
					str="PlayerTipsStr_11"
					break;
				}
				case ui.vaDefTxT:
				{
					str="PlayerTipsStr_13";
					break;
				}
				case ui.headAttTxT:
				{
					str="PlayerTipsStr_15";	
					break;
				}
				default:
				{
					break;
				}
			}
			if(str)
				_tips.showMain(StaticIni.getSwfLangStr(str))
			else
				_tips.hide();
		}
		/**
		 *显示函数 （主要入口）
		 * 如果是baseobject  就自己根据现有数据计算 出各属性
		 * 如果 是xml 说明是  其他人属性 向服务器请求；
		 * @param dataobj
		 * 
		 */		
		public function showProperty(dataobj:*):void
		{
			if(_mainObj==dataobj)
			{
//				_ui.showOrHide();
			}
			setData(dataobj,true);
			if(dataobj is BaseObject)
			{
//				if(!_ui.created)
//					_ui.showOrHide();
			}
			else /*if(_actorLogic.roleName==_mainRoleName)*///如果当前储存的数据 是需要查看人的数据  就直接刷新显示
			{
				showCurrentName(_actorLogic.currentName);
			}
//			else
//			{
//				SystemSender.getInstance().CustomMsg(CustomToServerFlag.CLIENT_CUSTOMMSG_LOOK_OTHER_DETAIL,new WString(_actorLogic.roleName));
//			}
		}
		/**
		 * 设置显示的数据
		 * @param dataobj 数据  支持（xml  dataobject）
		 * @param needRefresh	（是否刷新显示）
		 * @return 
		 * 
		 */		
		public function setData(dataobj:*,needRefresh:Boolean=false):DetailPropertyLogic
		{
			_mainObj=dataobj;
			_needRefreshUi=needRefresh;
			if(needRefresh)
			{
				refresh();
			}
			return this;
		}
		private function refresh():void
		{
//			facePic=ResourcesPath.getHeadPic(_mainObj.ModelId);
			if(_mainObj is BaseObject)
			{
				facePic;
				headAtt;
				hitProb;
				dodge;
				gardProb;
				guardweak;
				normalAtt;
				normalDef;
				skillAtt;
				skillDef;
				skillname;
				vaDamage;
				vaDef;
				vaProb;
				lvl;
				roleName;
				profress;
				maxlife;
				wardProb;
				wardweak;
			}
		}
		private function getPropertyFromData(propertyname:String):*
		{
			var str:String;
			 if(_mainObj is XML)
			{
				return getPropertyFromX(_mainObj as XML,propertyname)
			}
			else 
			{
				if(_mainObj is ObjectData)
				{
					str= (_mainObj as ObjectData).GetPropertiesEx(propertyname);
				}
				else
				{
					str=_mainObj[propertyname]
				}
				if(isNaN(Number(str)))
					return str;
				return Number(str);
			}
		}
		private function getPropertyFromX(xml:XML,pName:String):*
		{
			if(!(String(xml.attribute(pName))||String(xml.elements(pName))||String(xml.elements(PLAYER_PROPERTY).attribute(pName))))
				trace("Error~DetailPropertyLogic.getPropertyFromX(xml, pName)",pName,xml.elements(pName),xml.attribute(pName),String(xml.elements(PLAYER_PROPERTY).attribute(pName)));
			return String(xml.attribute(pName))||String(xml.elements(pName))||String(xml.elements(PLAYER_PROPERTY).attribute(pName));
////			var xml:XML=_mainObj as XML;
//			var xmllist:XMLList;
//			if(xml.name()==PLAYER)
//			{
//				xmllist=xml.elements(PLAYER_PROPERTY).attribute(pName);
//			}
//			else if(xml.name()		== PARTNER_ITEM)
//			{
//				xmllist=xml.elements(PARTNER_PROPERTY).attribute(pName);
//			}
//			else
//			{
//				trace("Error!~detalisPropertyLogic.getPropertyFromX(propertyName)",getQualifiedClassName(_mainObj))//,_nowList.name());
//			}
//			if(xmllist.length()==0)
//			{
//				trace("Error~DetailPropertyLogic.getPropertyFromX(propertyname)不存在",pName);
//			}
//			else
//			{
////				trace("DetailPropertyLogic.getPropertyFromX(propertyname)",pName,xmllist);
//			}
//			return xmllist
		}
		/**
		 *个人先攻值 
		 * @param value
		 * 
		 */		
		public function get headAtt():String 
		{
			var value:Number= (getPropertyFromData("SpeedRate") + getPropertyFromData("SpeedRateAdd") )* 
				(1 + (getPropertyFromData("SpeedRateMul") + getPropertyFromData("SpeedRateMulAdd")) / 100);
			var str:String=int(value)+""
			if(_needRefreshUi)
			ui.headAttTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_15",[str]);
			return str;
		}
		public function set headAtt(value:String):void 
		{
			ui.headAttTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_15",[outZero(value)]);
		}
		public function outZero(value:String):String
		{
			var str:String;
			if(Number(value))
			{
				if(value.indexOf(".")>-1)
				{
					if(value.charAt(value.length-1)=="0"||value.charAt(value.length-1)==".")
					{
						str=value.substr(0,value.length-1);
						return outZero(str);
					}
					else
					{
						str= value;
					}
				}
				else
				{
					str=value;
				}
			}
			else
			{
				str="0"
			}
			return str
		}
		/**
		 *韧性 
		 * @param value
		 * 
		 */		
		public function get vaDef():String 
		{
			var value:Number=(getPropertyFromData("PhyVaDefProb") + getPropertyFromData("PhyVaDefProbAdd")) ;
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
			{
//				ui.vaDefTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_13",[str])
				vaDef	=	str;
			}
			return str;
		}
		public function set vaDef(value:String):void 
		{
			ui.vaDefTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_13",[outZero(Number(value).toFixed(2))])
		}
		/**
		 *破招 
		 * @param value
		 * 
		 */		
		public function get guardweak():String 
		{
			var value:Number= (getPropertyFromData("DePhyGuardProb") + getPropertyFromData("DePhyGuardProbAdd")) 
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
				guardweak=str;
			return str
		}
		public function set guardweak(value:String):void 
		{
			ui.guardWeakTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_11",[outZero(Number(value).toFixed(2))]);
		}
		/**
		 *破击 
		 * @param value
		 * 
		 */		
		public function get wardweak():String 
		{
			var value:Number= (getPropertyFromData("DePhyWardProb") + getPropertyFromData("DePhyWardProbAdd")) 
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
				wardweak	=	str;
			return str
		}
		public function set wardweak(value:String):void 
		{
			ui.wardWeakTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_09",[outZero(Number(value).toFixed(2))]);
		}

		/**
		 *命中 
		 * @param value
		 * 
		 */		
		public function get hitProb():String 
		{
			var value:Number= (getPropertyFromData("PhyHitProb") + getPropertyFromData("PhyHitProbAdd")) 
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
				hitProb=str
			return str
		}
		public function set hitProb(value:String):void 
		{
			ui.hitProbTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_07",[outZero(Number(value).toFixed(2))]);
		}
		
		/**
		 *生命 
		 * @param value
		 * 
		 */		
		public function get maxlife():String 
		{
			var value:Number=	((getPropertyFromData("MaxHP")) + (getPropertyFromData("MaxHPAdd"))) * (1 + (getPropertyFromData("MaxHPMul") + (getPropertyFromData("MaxHPMulAdd")) / 100)
				+(getPropertyFromData("MaxHPBonus")) + (getPropertyFromData("MaxHPBonusAdd")));
			var str:String=int(value)+"";
			if(_needRefreshUi)
				maxlife	=	str;
			return str
		}
		public function set maxlife(value:String):void 
		{
			ui.lifeTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_01",[outZero(Number(value).toFixed(2))]);
		}

		/**
		 *必杀 
		 * @param value
		 * 
		 */		
		public function get vaDamage():String 
		{
			var value:Number= (/*getPropertyFromData("VaDamageRatio") +*/ getPropertyFromData("PhyVaDamageRatioAdd"))
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
			vaDamage=str
			return str;
		}
		public function set vaDamage(value:String):void 
		{
			ui.vaDamageTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_14",[outZero(Number(value).toFixed(2))]);
		}
		/**
		 *暴击 
		 * @param value
		 * 
		 */		
		public function get vaProb():String 
		{
			var value:Number= (getPropertyFromData("PhyVaProb") + getPropertyFromData("PhyVaProbAdd")) 
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
				vaProb	=	str;
			return str;
		}
		public function set vaProb(value:String):void 
		{
			ui.vaProbTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_12",[outZero(Number(value).toFixed(2))])
		}
		/**
		 *  * 虚招
		 * @param value
		 * 
		 */		
		public function get gardProb():String 
		{
			var value:Number= (getPropertyFromData("PhyGuardProb") + getPropertyFromData("PhyGuardProbAdd")) 
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
				gardProb =	str;
			return str;
		}
		public function set gardProb(value:String):void 
		{
			ui.gardProbTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_10",[outZero(Number(value).toFixed(2))]);
		}
		/**
		 * 抵挡
		 * @param value
		 * 
		 */		
		public function get wardProb():String 
		{
			var value:Number= (getPropertyFromData("PhyWardProb") + getPropertyFromData("PhyWardProbAdd")) 
			var str:String=value.toFixed(2);
			if(_needRefreshUi)
				wardProb	=	str
			return str
		}
		public function set wardProb(value:String):void 
		{
			ui.wardProbTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_08",[outZero(Number(value).toFixed(2))]);
		}
		/**
		 *闪避 
		 * @param value
		 * 
		 */		
		public function get dodge():String 
		{
			var value:Number= (getPropertyFromData("PhyDodgeProb") + getPropertyFromData("PhyDodgeProbAdd")) 
			var str:String=value.toFixed(2)
			if(_needRefreshUi)
				dodge	=	str;
			return str;
		}
		public function set dodge(value:String):void 
		{
			ui.dodgeTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_06",[outZero(Number(value).toFixed(2))]);
		}
		public function get normalDef():String 
		{
			var value:Number=	(getPropertyFromData("PhyDef") + getPropertyFromData("PhyDefAdd")) * (1 + (getPropertyFromData("PhyDefMul") + getPropertyFromData("PhyDefMulAdd") / 100)
				+getPropertyFromData("PhyDefBonus") + getPropertyFromData("PhyDefBonusAdd"));
			var str:String=int(value)+"";
			if(_needRefreshUi)
			normalDef	=	str;
			return str
		}
		public function set normalDef(value:String):void 
		{
			ui.normalDefTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_03",[outZero(Number(value).toFixed(2))])
		}
		public function set normalAtt(value:String):void 
		{
			ui.normalAttackTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_02",[outZero(Number(value).toFixed(2))]);
		}
		public function get normalAtt():String 
		{
			var value:Number=	(getPropertyFromData("PhyDamage") + getPropertyFromData("PhyDamageAdd")) * (1 + (getPropertyFromData("PhyDamageMul") + getPropertyFromData("PhyDamageMulAdd") / 100)
				+getPropertyFromData("PhyDamageBonus") + getPropertyFromData("PhyDamageBonusAdd"));
			var str:String=int(value)+"";
			if(_needRefreshUi)
				normalAtt=str;
			return str
		}
		public function get skillDef():String 
		{
			var value:Number=	(getPropertyFromData("MagDef") + getPropertyFromData("MagDefAdd")) * (1 + (getPropertyFromData("MagDefMul") + getPropertyFromData("MagDefMulAdd") / 100)
				+getPropertyFromData("MagDefBonus") + getPropertyFromData("MagDefBonusAdd"));
			var str:String=int(value)+"";
			if(_needRefreshUi)
				skillDef=str;
			return str
		}
		public function set skillDef(value:String):void 
		{
			ui.skillDefTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_05",[outZero(Number(value).toFixed(2))])//value+"";
		}
		/**
		 *技能攻击 
		 * @param value
		 * 
		 */		
		public function set skillAtt(value:String):void 
		{
			ui.skillAttackTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_04",[outZero(Number(value).toFixed(2))]);
		}
		public function get skillAtt():String 
		{
			var value:Number=	(getPropertyFromData("MagDamage") + getPropertyFromData("MagDamageAdd")) * (1 + (getPropertyFromData("MagDamageMul") + getPropertyFromData("MagDamageMulAdd") / 100)
				+getPropertyFromData("MagDamageBonus") + getPropertyFromData("MagDamageBonusAdd"));
			var str:String=int(value)+"";
			if(_needRefreshUi)
			skillAtt=str;
			return str
		}
		/**
		 *技能名 
		 * @param str
		 * 
		 */		
		public function get skillname():String 
		{
			var value:int=getPropertyFromData(ActorPropertyUI.SKILL_ID);
//			trace("DetailPropertyLogic.skillname()",value);
			var skill:String=StaticIni.getSwfLangStr(value+"");
			if(_needRefreshUi)
				skillname=skill+"";
			return skill
		}
		public function set skillname(str:String):void 
		{
			ui.skillTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_18",[str]);
		}
		/**
		 *职业 
		 * @param value
		 * 
		 */		
		public function get profress():String 
		{
			var value:int=getPropertyFromData(ActorPropertyUI.GANG);
			var str:String=GameDefine.PART_PROFTYPE(value)//StaticIni.getSwfLangStr(value);
			if(_needRefreshUi)
				profress=str
			return str
		}
		/**
		 *职业 
		 * @param value
		 * 
		 */		
		public function set profress(value:String):void 
		{
			ui.professTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_17",[value]);
		}
		/**
		 *头像 
		 * @param url
		 * 
		 */		
		public function set facePic(url:String):void 
		{
			ui.faceClip.source=url;
		}
		public function get facePic():String 
		{
			var close:String=getPropertyFromData(ActorPropertyUI.CLOTHE_MODEL);
			var url:String=ResourcesPath.getHeadPic(getPropertyFromData(ActorPropertyUI.MODEL),(_mainObj is ViewObject)?0:(close=="0"?1:int(close)))
			if(_needRefreshUi)
			ui.faceClip.source=url//url;
			return url;
		}
		/**
		 *等级 
		 * @param lvl
		 * 
		 */		
		public function get lvl():String 
		{
			var value:int=getPropertyFromData(ActorPropertyUI.LEVEL);
			var str:String=value+"";
			if(_needRefreshUi)
				lvl=str;
			return str
		}
		public function set lvl(lvl:String):void 
		{
			ui.lvlTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_00",[lvl]);
		}
		/**
		 *外功 str
		 * @return 
		 * 
		 */		
		public function get outwork():String
		{
			return getPropertyFromData("Str")+getPropertyFromData("StrAdd")
		}
		/**
		 *内功Ing 
		 * @return 
		 * 
		 */		
		public function get interwork():String
		{
			return getPropertyFromData("IngAdd")+getPropertyFromData("Ing");
		}
		/**
		 *体魄Sta 
		 * @return 
		 * 
		 */		
		public function get sta():String
		{
			return getPropertyFromData("Sta")+getPropertyFromData("StaAdd");
		}
		/**
		 *角色名 
		 * @param name
		 * 
		 */		
		public function set roleName(name:String):void 
		{
			ui.nameTxT.htmlStr=StaticIni.getSwfLangStrVar("PlayerProperty_16",[name]);
		}
		public function get roleName():String 
		{
			var configId:String=getPropertyFromData("ConfigID");
			var value:String
			if(configId&&configId!="0")
			{
				value=StaticIni.getSwfLangStr(configId);
			}
			else
			{
				value=getPropertyFromData(ActorPropertyUI.NAME);
			}
			var str:String=(value)?value:ActorPropertyLogic.getInstance().roleName;
			if(_needRefreshUi)
			roleName=str
			return str
		}
		public function addAllListener():void
		{
			ui.windowBG	.addEventListener(	NxWindowEvent.WINDOW_CLOSE,	onClickClose);	
			ui.windowBG.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandle);
		}
		
		public function removeAllListener():void
		{
			ui.windowBG	.removeEventListener(	NxWindowEvent.WINDOW_CLOSE,	onClickClose);	
			ui.windowBG.removeEventListener(MouseEvent.MOUSE_OVER,mouseOverHandle);
		}
		private function onClickClose(e:Event):void
		{
			ui.hide();
		}
		
		public function get ui():DetailPropertyUI
		{
			if(_ui==null)
			{
				_ui=new DetailPropertyUI(this)
			}
			return _ui as DetailPropertyUI
		}
		
		public function BeforeShow():void
		{
			addAllListener();
		}
		
		public function Init():void
		{
			_ui.faceClip.mouseChildren=false;
			_ui.facBG["img01"].addChild(_ui.faceClip);
			_ui.faceClip.x=_ui.faceClip.y=0;
			addAllListener();
			_model=ModelLocator.getInstance();
			_tips=TipsMainLogic.instance;
			_actorLogic=ActorPropertyLogic.getInstance();
//			if(_isother)
//				_model.addEventListener(String(CustomToClientFlag.SERVER_CUSTOMMSG_ROLE_EQUIPS_INFO),getDetailsXml,false,1);
		}
		private function getDetailsXml(e:CustomMsgEvent):void
		{
			var xml:XML=XML(e.pList[1]);
//			trace("DetailPropertyLogic.getDetailsXml(e)",xml.name());
			_mainRoleName=e.pList[0];
//			trace("DetailPropertyLogic.getDetailsXml(e)",_mainRoleName);
//			trace("roleName=",_mainRoleName);
//			trace("_actorLogic.roleName=",_actorLogic.roleName);
			if(_actorLogic.roleName==_mainRoleName)
			{
				var _playerXml:XML=xml.elements(PLAYER)[0];
				if(_playerXml)
					_partnerXmap[_mainRoleName]=_playerXml;
//					trace("getPropertyFromX(j,NAME)=",getPropertyFromX(_partX[j],NAME));
				var xxx:XML=ActorPropertyLogic.getInstance().currentSelectedM["data"]
					_partnerXmap[StaticIni.getSwfLangStr(getPropertyFromX(xxx,ActorPropertyUI.CONFIG_ID))]=xxx;
			}
			else
			{
				_playerXml=xml.elements(PLAYER)[0];
				if(_playerXml)
					_partnerXmap[_mainRoleName]=_playerXml;
				var _partX:XMLList=xml.elements(PLAYER).elements(PARTNER).elements(ITEM);
				for (var j:int = 0; j < _partX.length(); j++) 
				{
					//					trace("getPropertyFromX(j,NAME)=",getPropertyFromX(_partX[j],NAME));
					_partnerXmap[StaticIni.getSwfLangStr(getPropertyFromX(_partX[j],ActorPropertyUI.CONFIG_ID))]=_partX[j];
				}
			}
//			showCurrentName(_actorLogic.currentName);
		}
		/**
		 *显示当前名字的人 
		 * @param name
		 * 
		 */		
		public function showCurrentName(name:String):void
		{
//			trace("DetailPropertyLogic.showCurrentName(name)");
//			trace("name=",name);
			var xml:XML=_partnerXmap[name];
			if(!xml)
			{
				//				trace("Error~DetailPropertyLogic.showCurrentName(name)没这个人？",name);
				//没有这个人
				xml=_mainObj.elements(PLAYER_PROPERTY)[0]
			}
				for (var i:String in propertyMap) 
				{
					this[i]	=	getPropertyFromX(xml,propertyMap[i]);
				}
				if(_mainObj is XML)
				{
					facePic;
					roleName;
					profress;
					skillname;
				}
				if(!_ui.created)
					_ui.showOrHide();

		}
		
		
		
	}
}